<style>
	.quote_tooltip {
		background: url("<?php echo $this->baseUrl() ?>/img/quote_tooltip_upside.png") no-repeat scroll left top transparent;
		display: block;
		height: 6px;
		left: 85px;
		position: absolute;
		top: -6px;
		width: 14px;
	}
	.add_note:hover, .content_tooltip > ul > li a:hover {
		text-decoration: none;
	}
	.wrap_tooltip {
		display: inline;
		height: 15px;
		line-height: 24px;
		margin-left: 5px;
		position: relative;
		width: 10px;
	}
	
	.tooltip_note {
		color: #464646;
		font-size: 11px;
		padding-left: 0;
	}
	.content_tooltip p {
		border: none;
		text-decoration:none;
	}
	.content_tooltip {
		background: none repeat scroll 0 0 #FFFCB1;
		border: 1px solid #DFDA5F;
		display: none;
		left: -80px;
		padding: 5px 12px 0px;
		position: absolute;
		top: 26px;
		z-index:99999;
	}
	.content_tooltip p {
		padding-bottom: 5 px;
	}
	.content_tooltip > ul {
		text-align: right;
	}
	.content_tooltip > ul > li {
		display: inline-block;
		padding-top: 5px;
	}
	.content_tooltip > ul > li a:hover {
		text-decoration: none;
	}
	.content_tooltip:hover {
		display: block;
	}
	.tooltip_note:hover + .content_tooltip, .content_tooltip:hover {
		display: block;
	}
	.comment{ font-family: Arial, sans-serif; color:#000; font-size:11px}
	.sm_paypal {
		height: 24px;
		line-height: 24px;
		text-align: left;
		vertical-align: middle;
		float:right;
		width: 810px;
	}
	.sm_paypal > span {
		font-size: 13px;
		height: 24px;
		line-height: 24px;
		padding-right: 5px;
		vertical-align: top;
		float:left;
		margin-left: 20px;
	}
    .sm_paypal form input[type="image"]
    {
        cursor: pointer;
    }
	span.paid_campaign
	{
		line-height: 18px;
		margin-top:-12px;
	}
	.wrap_tooltip a 
	{
		color: #0066CC;
		font-size: 14px;
		text-decoration: none;
		word-wrap: normal;
		font-weight: bold;
	}
	.wrap_tooltip a:hover
	{
		color: #0099FF;
		text-decoration: none;
	}
	.sm_admin_setting:hover, .sm_paypal:hover {
		cursor: default;
	}
</style>
<script>
	(function($){
		$.fn.ymTooltip = function(options){
			var defaults = {
				width: 250
			}
						 
			var options =  $.extend(defaults, options);	
					
			return this.each(function(){
				var obj = $(this);
				var html = '<span class="wrap_tooltip">' +
					'<a class="tooltip_note" href="javascript:void(0);">' + obj.html() + '</a>' +
					'	<span class="content_tooltip">' +
					'  	<span class="quote_tooltip">&nbsp;</span>' +
					' 		<p class="comment" style="text-align:left">' + obj.attr('tooltip') + '</p>' +
					'	</span>' +
					'</span>';
				$(obj).html(html);
				$('.content_tooltip').css('width',options.width);
			});
		}
	})(jQuery);
	$(document).ready(function(){
		$("#helpTooltip").ymTooltip({width:180});
	});
</script>
<?php $payment = Payment_Manager::getInstance(); ?>
<?php $campaign = $payment->getHandlerByCode(Payment_Item_Campaign::CODE); ?>
<?php $fan_count = $this->social->getFanCount($this->social->getIdPage());?>
<?php $price = $payment->getHandlerByCode(Payment_Item_Campaign::CODE)->getPrice($fan_count);?>
<?php if ($campaign->isValid($this->social->getIdPage())): ?>
	<?php $paid_price = $campaign->getPaidPrice($this->social->getIdPage());?>
<span><?php echo sprintf($this->translate('MSG_AFTER_PAID_CAMPAIGN'), $paid_price, ' - ', date('d-M-Y', $payment->getTimeExpired($this->social->getIdPage(), Payment_Item_Campaign::CODE))); ?></span>
<?php else: ?>

	<?php if($price==0):?>
		<?php $tooltip = '<a href="javascript:void(0)" id="helpTooltip" tooltip="' . $this->translate('MSG_PAID_CAMPIAN_FREE_TOOLTIP'). '">?</a>';?>
		<span><?php echo sprintf($this->translate('MSG_PAID_CAMPAIGN_FREE'),$tooltip); ?> [ <a href="http://media.younetco.com/pricing" target="_blank"><?php echo $this->translate('PRICING_DETAIL')?></a> ]</span>
	<?php endif;?>
	
	<?php if($price>0):?>
		<form target="_blank" style="display: inline;float:right" method="post" action="<?php echo $payment->getPayPalUrl() ?>">
			<input type="hidden" value="_xclick-subscriptions" name="cmd"/>
			<input type="hidden" value="<?php echo $payment->getBusinessEmail() ?>" name="business"/>
			<input type="hidden" value="RO" name="lc"/>
			<input type="hidden" value="<?php echo $this->escape($this->translate('APP_NAME') . ' : Facebook page ' . $this->social->getIdPage() . ' - ' . $payment->getItemTitle(Payment_Item_Campaign::CODE)) ?>" name="item_name"/>
			<input type="hidden" value="<?php echo Payment_Item_Campaign::CODE ?>" name="item_number"/>
			<input type="hidden" value="1" name="no_note"/>
			<input type="hidden" value="1" name="no_shipping"/>
			<input type="hidden" value="1" name="rm"/>
			<input type="hidden" value="<?php echo $this->serverUrl($this->url(array('module' => 'payment', 'controller' => 'index', 'action' => 'index', 'id_page' => $this->social->getIdPage(), 'id_user' => $this->social->getUser()->id), 'default', true)); ?>" name="notify_url"/>
			<input type="hidden" value="1" name="src"/>
			<input type="hidden" value="<?php echo $price ?>" name="a3"/>
			<input type="hidden" value="1" name="p3"/>
			<input type="hidden" value="M" name="t3"/>
			<input type="hidden" value="USD" name="currency_code"/>
			<input type="image" border="0" alt="PayPal - The safer, easier way to pay online!" name="submit" src="<?php echo STATIC_URL ?>/img/paypalsubscribe.png"/>
		</form>
		<?php $tooltip = '<a href="javascript:void(0)" id="helpTooltip" tooltip="' . $this->translate('MSG_PAID_CAMPAIGN_TOOLTIP'). '">?</a>';?>
		<span><?php echo sprintf($this->translate('MSG_PAID_CAMPAIGN'), $tooltip); ?> [ <a href="http://media.younetco.com/pricing" target="_blank"><?php echo $this->translate('PRICING_DETAIL')?></a> ]</span>
		<div style="position: absolute; top: 10px; right: 5px;"><?php echo sprintf($this->translate('MSG_PAID_CAMPAIGN_UPGRADE'),$price);?></div>
	<?php endif;?>
<?php endif; ?>